<?php
defined('BME_INSERTION') or die('Error code: '.BME_INVALID_INSERT_ERROR);

$id=0;
switch($query){
	case 'sequence':
		require_once(BME_ROOT."core/Dataset.php");
		$Dss=new BME_Dataset();
		$optDs="<option selected='selected' value=''>%%form_any%%</option>";
		foreach($Dss->getAll() as $id){
			$Ds=new BME_Dataset($id);
			$optDs.="<option value='".$Ds->getId()."'>".$Ds->getName()."</option>";
		}
		$Dss->openDB();
		$res=$Dss->DBquery("desc `Sequence` `gen`");
		$row=$Dss->DBfetch_assoc($res);
		$types=split(",",ereg_replace("^enum\((.*)\)","\\1",$row["Type"]));
		$Dss->closeDB();
		$optGn="<option selected='selected' value=''>%%form_any%%</option>";
		foreach($types as $type) $optGn.="<option value=$type>".substr($type,1,-1)."</option>";
		$header="<h1>%%form_sSq_header%%</h1>";
		$form="
		<dd><label for='$query-".(++$id)."'>%%form_sSq_name%%</label><br/>&nbsp;</dd><dd>
			<select id='$query-$id' name='gene'>$optGn</select></dd><br/><br/>
		<dd><label for='$query-".(++$id)."'>%%form_sSq_dataset%%</label><br/>&nbsp;</dd><dd>
			<select id='$query-$id' name='dataset'>$optDs</select></dd><br/><br/>
		<dd><label for='$query-".(++$id)."'>%%form_sSq_description%%</label><br/>&nbsp;</dd><dd>
			<input id='$query-$id' type='text' size='30' name='description'
				title='%%form_sSq_description_t%%'/></dd><br/><br/>
		";
	break;
}

?>
